﻿using System;

namespace LibraryGuard.Interfaces
{
	/// <summary>
	/// Data provider for AST.
	/// </summary>
	public interface IDataProvider
	{
		/// <summary>
		/// Gets variable with specified name.
		/// </summary>
		/// <param name="name"></param>
		/// <returns></returns>
		IValue GetVariable(string name);

		/// <summary>
		/// Calls function with specified name and args.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="args"></param>
		/// <returns></returns>
		IValue CallFunction(string name, params IValue[] args);

		/// <summary>
		/// Gets function return type.
		/// </summary>
		/// <param name="name"></param>
		/// <returns></returns>
		TypeCode GetFunctionReturnType(string name);

		/// <summary>
		/// Gets variable type.
		/// </summary>
		/// <param name="name"></param>
		/// <returns></returns>
		TypeCode GetVariableType(string name);
	}
}
